//
//  CAICameraOverlayBottomView.h
//  CAIImagePickerControllerKit
//
//  Created by 海参 on 2022/8/2.
//

#import <UIKit/UIKit.h>
#import "CAICameraPhotoInfoModel.h"

NS_ASSUME_NONNULL_BEGIN


@class CAICameraOverlayBottomView;
@protocol CAICameraOverlayBottomViewDelegate <NSObject>


///取消
- (void)cameraOverlayBottomViewDidCancel:(CAICameraOverlayBottomView *)view;


///拍照
- (void)cameraOverlayBottomViewDidTake:(CAICameraOverlayBottomView *)view;

///拍照超过数量不允许
- (void)cameraOverlayBottomViewDidTakeLimitNumberNotAllow:(CAICameraOverlayBottomView *)view;


///预览切换到拍照
- (void)cameraOverlayBottomViewDidSwitchPreviewToTakePhoto:(CAICameraOverlayBottomView *)view;


/// 删除事件
- (void)cameraOverlayBottomView:(CAICameraOverlayBottomView *)view commitDeleteForRowAtIndexPath:(NSIndexPath *)indexPath;

/// 点击photo进入预览
/// @param view 当前对象
/// @param index 索引
- (void)cameraOverlayBottomView:(CAICameraOverlayBottomView *)view didSelectItemAtIndex:(NSInteger)index;

@end


# define BottomViewScaleHeight(X) [CAICameraOverlayBottomView bottomViewScaleHeight:X]


@interface CAICameraOverlayBottomView : UIView

@property (nonatomic, weak) id <CAICameraOverlayBottomViewDelegate>delegate;


/// 确定按钮事件
@property (nonatomic, copy) void (^didPickImagesBlock)(NSArray <UIImage *> *images,NSArray <CAIUIImagePickerCameraPhotoModel *> *models);


/// 最多item数量，到达这个数，就不能再加入;默认0，不限制；
@property (nonatomic, assign) NSInteger maxItemCount;



/// 主题色
@property (nonatomic, strong) UIColor *commonTintColor;


/// 拍照后增加图片，并刷新UI
- (void)takePictureWithAddPhoto:(nullable CAICameraPhotoInfoModel *)photoModel;

@property (nonatomic, strong) NSArray *imageArray;


/// 返回到拍照功能
- (void)backToCamera;

+ (CGFloat)bottomViewHeight;

+ (CGFloat)bottomViewScaleHeight:(CGFloat)height;


/// 选中预览列表图的指定item
- (void)selectPreviewPhotosViewItemAtIndex:(NSInteger)index;


- (NSInteger)indexForPreviewPhotosViewSelect;

@end

NS_ASSUME_NONNULL_END
